package com.gmail.avereshchaga.web.form;

import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.NotBlank;
import com.gmail.avereshchaga.web.validate.Birthdate;

public class EmployeeForm {

    private Long id;

    @NotBlank(message = "First Name must be set")//"{firstNameError}")
    @Pattern(regexp = "[a-zA-Zа-яА-я\\s]+", message = "First Name must be alphabetical")
    private String firstName;

    @NotBlank(message = "Last Name must be set")
    @Pattern(regexp = "[a-zA-Zа-яА-Я\\s]+", message = "Last Name must be alphabetical")
    private String lastName;

    @NotBlank(message = "Salary must be set")
    @Pattern(regexp = "[0-9]{1,15}(\\.){0,1}[0-9]{0,2}", message = "Salary must be in format %15.2f (a positive number, only 15 characters, 2 decimal digits after the decimal point)")
    private String salaryStr;

    @NotBlank(message = "Birthdate must be set")
    @Pattern(regexp = "[0-3]{0,1}[0-9]{1}(\\.)[0-1]{0,1}[0-9]{1}(\\.)[0-9]{4}", message = "Birthdate must be in format DD.MM.YYYY")
    @Birthdate
    private String birthdateStr;

    private boolean active;

    private Long divisionId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public Long getDivisionId() {
        return divisionId;
    }

    public void setDivisionId(Long divisionId) {
        this.divisionId = divisionId;
    }

    public String getSalaryStr() {
        return salaryStr;
    }

    public void setSalaryStr(String salaryStr) {
        this.salaryStr = salaryStr;
    }

    public String getBirthdateStr() {
        return birthdateStr;
    }

    public void setBirthdateStr(String birthdateStr) {
        this.birthdateStr = birthdateStr;
    }

}
